# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=qt6-grpc
_qtver=6.6.0
pkgver=${_qtver/-/}
pkgrel=2
arch=(loong64 x86_64)
url='https://www.qt.io'
license=(GPL3 LGPL3 FDL custom)
pkgdesc='Provides the modules QtGrpc and QtProtobuf'
depends=(abseil-cpp
         gcc-libs
         glibc
         grpc
         protobuf
         qt6-base)
makedepends=(cmake
             ninja)
groups=(qt6)
_pkgfn=${pkgname/6-/}-everywhere-src-$_qtver
source=(https://download.qt.io/official_releases/qt/${pkgver%.*}/$_qtver/submodules/$_pkgfn.tar.xz)
sha256sums=('dab9b95fadc759deaca36e423f5ee6924eeec6e18a806c4b7e0d710f36c7ed92')

build() {
  cmake -B build -S $_pkgfn -G Ninja \
    -DCMAKE_MESSAGE_LOG_LEVEL=STATUS
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  install -d "$pkgdir"/usr/share/licenses
  ln -s /usr/share/licenses/qt6-base "$pkgdir"/usr/share/licenses/$pkgname
}
